package practice;

import java.util.LinkedList;
import java.util.List;

public class test1 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        List<Integer> list = new LinkedList<>();
        for(int x : arr) {
            list.add(x);
        }

        for(int x : list) {
            System.out.print(x + " ");
        }
        int left = 0;
        int right = arr.length-1;
        while(left < right) {
            int tmp = arr[left];
            arr[left] = arr[right];
            arr[right] = tmp;
            left++;
            right--;
        }
        System.out.println();
        for(int x : arr) {
            System.out.print(x + " ");
        }
    }
}
